package com.tencent.mm.opensdk.modelmsg;

import android.os.Bundle;
import android.util.Log;

import com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject;

public class WXTextObject implements IMediaObject {
    private static final int LENGTH_LIMIT = 10240;
    private static final String TAG = "MicroMsg.SDK.WXTextObject";
    public String text;

    public WXTextObject() {
        this(null);
    }

    public WXTextObject(String arg1) {

        this.text = arg1;
    }

    public boolean checkArgs() {
        boolean v0;
        if(this.text == null || this.text.length() == 0 || this.text.length() > 10240) {
            Log.e("MicroMsg.SDK.WXTextObject", "checkArgs fail, text is invalid");
            v0 = false;
        }
        else {
            v0 = true;
        }

        return v0;
    }

    public void serialize(Bundle arg3) {
        arg3.putString("_wxtextobject_text", this.text);
    }

    public int type() {
        return 1;
    }

    public void unserialize(Bundle arg2) {
        this.text = arg2.getString("_wxtextobject_text");
    }
}

